<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
	<title>test</title>
</head>
<body>
	<wx-open-launch-weapp
	  id="launch-btn"
	  username="gh_74a1b19d2f25"
	  path=""
	>
	  <script type="text/wxtag-template">
	    <style>.btn { padding: 12px }</style>
	    <button class="btn">打开小程序</button>
	  </script>
	</wx-open-launch-weapp>
</body>
<script src="/cdn/jquery.min.10.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="text/javascript">
	wx.config({
	  debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
	  appId: "{$wxConfig['appId']}", // 必填，公众号的唯一标识
	  timestamp: "{$wxConfig['timestamp']}", // 必填，生成签名的时间戳
	  nonceStr: "{$wxConfig['nonceStr']}", // 必填，生成签名的随机串
	  signature: "{$wxConfig['signature']}",// 必填，签名
	  jsApiList: ['openLocation'], // 必填，需要使用的JS接口列表
	  openTagList: ['wx-open-launch-weapp'] // 可选，需要使用的开放标签列表，例如['wx-open-launch-app']
	});
	wx.ready(function(){
	  var btn = document.getElementById('launch-btn');
	  btn.addEventListener('launch', function (e) {
	    console.log('success');
	  });
	  btn.addEventListener('error', function (e) {
	    console.log('fail', e.detail);
	  });	
	});
	wx.error(function(res){
	  alert(res.errMsg);
	});
</script>
</html>